package com.ps.property;

import lombok.Getter;

/**
 * @author gt
 * @类说明： 响应码枚举
 * @date 2020/10/22 16:50
 */
@Getter
public enum  ResultCode {
    //1000系列通用错误
    SUCCESS(1000, "操作成功"),
    FAILED(1001, "接口错误"),
    VALIDATE_FAILED(1002, "参数校验失败"),
    ERROR(1003, "未知错误"),

    //2000系列用户错误
    USER_NOT_EXIST(2000,"用户不存在"),
    USER_LOGIN_FAIL(2001,"用户名或密码错误"),
    USER_NOT_LOGIN(2002,"用户还未登录,请先登录"),
    NO_PERMISSION(2003,"权限不足,请联系管理员"),

    /**操作成功*/
    CODE_1(1,"操作成功"),
    /**操作失败*/
    CODE_0(0,"操作失败"),

    /**服务器内部错误*/
    CODE_500(500,"服务器内部错误"),


    /**操作业务失败*/
    CODE_10000(10000,"操作业务失败"),

    /**登录失败*/
    CODE_10100(10100,"登录失败"),

    /**校验参数失败*/
    CODE_20000(20000,"操作业务失败");

    private int code;
    private String msg;

    ResultCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
